<?php use_javascript('jquery-1.3.2.min.js') ?>
<?php use_helper ('Form','Javascript','Object', 'DateForm') ?>

<style>
table.ror{
	color:#000;
	font-size: 10px;
	font-weight: normal;
	font-family: Arial, Helvetica, sans-serif;
	background-color:#FFFFFF;
	padding:0px;
	width:900px;
}

table.ror td, table.ror th{
	border:1px solid #000;
}
</style>

<?php if (count($bills)): ?>
<table border="0" cellspacing="0" cellpadding="0" width="900px">
    <tr style="text-align:right !important">
        <td height="30" style="text-align:right !important; font-size:24px;"><strong style="text-decoration:underline;">RoR for <?php echo $bde_name;?> Area for the month of <?php echo $bill_month;?></strong></td>
        <td style="text-align:right"><span style="text-align:right;"> (702 - Pak Works Sec)</span></td>
    </tr>
    
    <tr style="text-align:right !important">
        <td colspan="2" height="30" >&nbsp; </td>
    </tr>

    
</table> 
 

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="ror">
    <tr style="border-bottom:1px solid #000;">
        <th width="2%" style="text-align:left;">Sr.</th>
        <th width="6%" style="text-align:left;">Page No.</th>
        <th width="12%" style="text-align:left;">Building No.</th>
        <th width="8%" style="text-align:left;">Army No.</th>
        <th width="13%" style="text-align:left;">Rank/Name</th>
        <th width="12%" style="text-align:left;">Unit</th>
        <th width="6%" style="text-align:left;">Previous Reading</th>
        <th width="6%" style="text-align:left;">Present Reading</th>
        <th width="7%" style="text-align:left;">Units Consumed</th>
        <th width="4%" style="text-align:left;">E.C</th>
        <th width="5%" style="text-align:left;">Water</th>
        <th width="3%" style="text-align:left;">TV</th>
        <th width="4%" style="text-align:left;">AC Chrgs</th>
		<th width="5%" style="text-align:left;">Total</th>
        <th width="7%" style="text-align:left;">Remarks</th>
    </tr>

<?php foreach ($bills as $j => $bill) : ?>
    <tr>
        <td align="left"><?php echo $j+1;?></td>
        <td align="left"><?php echo $bill->getConsumerNo(); ?></td>
        <td align="left"><?php echo $bill->getBuilding();?></td>
        <td align="left"><?php echo $bill->getOccupant()->getArmyNo();?></td>
        <td align="left"><?php echo $bill->getOccupant()->getRank().' '.$bill->getOccupant()->getName(); ?> </td>
        <td align="left"><?php echo $bill->getOccupant()->getUnit();?></td>
        <td align="left"><?php echo $bill->getPreviousReading(); ?></td>
        <td align="left"><?php echo $bill->getPresentReading(); ?></td>
        <td align="left"><?php echo $total_units = $bill->getUnitsConsumed() - $bill->getUnitsFree(); ?></td>
        <td align="left"><?php echo $bill->getUnitsTotal();?></td>
        <td align="left"><?php echo $bill->getWaterCharges();?></td>
        <td align="left"><?php echo $bill->getTvCharges();?></td>
        <td align="left"><?php echo $total_ac = $bill->getSplitCharges() + $bill->getWindowCharges();?></td>
		<td align="left"><?php echo $bill->getGrandTotal(); ?></td>
        <td align="left">&nbsp;</td>
    </tr>

<?php endforeach; ?>
   
</table>
	<?php else:?>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ror">
   
  <tr>
        <td style="background:none; text-align:center; color:#F00; font-size:24px;"><?php echo "No Record Found. Please enter Bills for the month." ?></td>
    </tr>
    </table>
    <?php endif; ?>